import Vue from 'vue'
import VueRouter from 'vue-router'

import MyAbout from '@/components/MyAbout.vue'
import MyMovie from '@/components/MyMovie.vue'
import MyHome from '@/components/MyHome.vue'
import MySports from '@/components/MySports'

import AboutYou from '@/components/AboutYou'
import AboutMe from '@/components/AboutMe'

Vue.use(VueRouter)

const router = new VueRouter({
  linkActiveClass: 'aa', // 模糊类
  linkExactActiveClass: 'bb', // 精确类
  routes: [
    { name: 'home', path: '/home', component: MyHome },
    { name: 'movie', path: '/movie/:id/:name', component: MyMovie },
    { name: 'sport', path: '/sport', component: MySports },
    {
      name: 'about',
      path: '/about',
      component: MyAbout,
      children: [
        { name: 'me', path: 'me', component: AboutMe },
        { name: 'you', path: 'you', component: AboutYou }
      ]
    }
  ]
})

export default router
